package io.github.chutian0610.sqlparser.dialect

import io.github.chutian0610.sqlparser.token.CodePoint

class GenericDialect : Dialect {
    override fun isIdentifierPart(c: CodePoint): Boolean {
        return c.isAlphabetic()
                || c.isAsciiDigit()
                || CodePoint.equalsChar(c, '$')
                || CodePoint.equalsChar(c, '@')
                || CodePoint.equalsChar(c, '#')
                || CodePoint.equalsChar(c, '_')
    }

    override fun isIdentifierStart(c: CodePoint): Boolean {
        return c.isAlphabetic()
                || CodePoint.equalsChar(c, '_')
                || CodePoint.equalsChar(c, '#')
                || CodePoint.equalsChar(c, '@')
    }

    override fun isDelimitedIdentifierStart(c: CodePoint): Boolean {
        return CodePoint.equalsChar(c, '"') || CodePoint.equalsChar(c, '`')
    }

    override fun supportsNestedComments(): Boolean = true
    override fun supportsPipeOperator(): Boolean = true
}